#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int main()
{
    char ch;
    while ((ch = getchar()) != EOF) {
        if (ch == '\n')
            continue;
        if (ch >= 'a' && ch <= 'z')
            printf("%c", ch - 32);
        else if (ch >= 'A' && ch <= 'Z') {
            printf("%c", ch + 32);
        }
        printf("\n");
    }
    return 0;
}